
// 创建一个路由器，并暴露出去
// 第一步：引入createRouter
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import antvs from '../views/antvs.vue';
import table from '../views/table.vue';
import practice from '../views/practice.vue';
import jsoncrack from '../views/jsoncrack.vue';
import menuPage from '../views/menuPage.vue';
import node from '../views/node.vue';
 
// 第二步：创建路由
const routes: Array<RouteRecordRaw> = [
  {
    path: '/antvs',
    name: 'antvs',
    component: antvs,
    // children: [
      // 添加子路由
      // {
      //   path: '/example',
      //   name: 'Example',
      //   component: ExampleComponent,
      // },
    // ],
  },
  {
    path: '/table',
    name: 'table',
    component: table,
  },
  {
    path: '/practice',
    name: 'practice',
    component: practice,
  },
  {
    path: '/jsoncrack',
    name: 'jsoncrack',
    component: jsoncrack,
  },
  {
    path: '/menuPage',
    name: 'menuPage',
    component: menuPage,
     // children: [
      // 添加子路由
      // {
      //   path: 'example',   子级路径不需要写/ ,加也可以
      //   name: 'Example',
      //   component: ExampleComponent,
      // },
    // ],
  },
  {
    path: '/node',
    name: 'node',
    component: node,
  },
];
// 创建路由器
const router = createRouter({
  history: createWebHistory(),  //路由器的工作模式
  routes,  //路由规则
});
// 暴露出去router
export default router